add_executable(tst_boundingsphere WIN32 MACOSX_BUNDLE
    ../../core/common/testpostmanarbiter.cpp ../../core/common/testpostmanarbiter.h
    ../commons/testrenderer.cpp ../commons/testrenderer.h
    ../qmlscenereader/qmlscenereader.cpp ../qmlscenereader/qmlscenereader.h
    tst_boundingsphere.cpp
)
qt_add_qml_module(tst_boundingsphere
    URI tst_boundingsphere
    VERSION ${PROJECT_VERSION}
    QML_FILES
        sphere.qml
        cube.qml
    NO_RESOURCE_TARGET_PATH
)

# Avoid collision between executable name and QML module directory (QTBUG-98568).
if(NOT WIN32 AND NOT APPLE)
    set_property(TARGET tst_boundingsphere PROPERTY OUTPUT_NAME tst_boundingsphere_app)
endif()

target_include_directories(tst_boundingsphere PRIVATE
    ../../core/common
    ../commons
    ../qmlscenereader
)

target_link_libraries(tst_boundingsphere PRIVATE
    Qt${QT_VERSION_MAJOR}::3DCore
    Qt${QT_VERSION_MAJOR}::3DCorePrivate
    Qt${QT_VERSION_MAJOR}::3DExtras
    Qt${QT_VERSION_MAJOR}::3DQuick
    Qt${QT_VERSION_MAJOR}::3DQuickExtras
    Qt${QT_VERSION_MAJOR}::3DQuickPrivate
    Qt${QT_VERSION_MAJOR}::3DRender
    Qt${QT_VERSION_MAJOR}::3DRenderPrivate
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::CorePrivate
    Qt${QT_VERSION_MAJOR}::Gui
    Qt${QT_VERSION_MAJOR}::Qml
    Qt${QT_VERSION_MAJOR}::Quick
    Qt${QT_VERSION_MAJOR}::Test
)

if(useCommonTestAspect)
    target_sources(tst_boundingsphere PUBLIC
        ../commons/testaspect.cpp ../commons/testaspect.h
    )
endif()

if(QT_FEATURE_private_tests)
    target_sources(tst_boundingsphere PUBLIC
        ../../core/common/qbackendnodetester.cpp ../../core/common/qbackendnodetester.h
    )
endif()

install(TARGETS tst_boundingsphere
    BUNDLE DESTINATION .
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

# Consider using qt_generate_deploy_app_script() for app deployment if
# the project can use Qt 6.3. In that case rerun qmake2cmake with
# --min-qt-version=6.3.
